#light

open System.Data.SqlClient

/// gets some data about the customers
let retrieveCustomerDetails =
  // setup a db connection
  use conn = new SqlConnection(@"Data Source = .\sqlexpress; Initial Catalog = Northwind; Integrated Security=true")
  // an inline sql statement - use sprocs
  use cmd = new SqlCommand("select ContactName, CompanyName from Customers", conn)
  conn.Open()
  use rdr = cmd.ExecuteReader()
  while rdr.Read() do
    printfn "Contact Name: %s Company: %s" (rdr.GetString(0)) (rdr.GetString(1))

  
retrieveCustomerDetails